package com.dnjn.happiness.cms.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dnjn.happiness.common.core.annotation.Excel;
import com.dnjn.happiness.common.core.web.domain.BaseEntity;
import com.dnjn.happiness.common.core.xss.Xss;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.time.LocalDateTime;

/**
 * 文章管理对象 cms_article
 * 
 * @author amber
 * @date 2023-10-10
 */
@Getter
@Setter
@TableName("cms_article")
public class Article extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /**  */
    private LocalDateTime dateStart;

    /**  */
    private LocalDateTime dateEnd;

    /** 备注 */
    private String remark;

    /** 是否删除|0-否 1-是|valid */
    private String deleted;

    /** 版本号 */
    private Integer version;

    /** PK */
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "article_id", type = IdType.ASSIGN_ID)
    private Long articleId;

    /** 厂区id */
    private Long siteId;

    /**  */
    private String articleTitle;

    /**  */
    @Xss(message = "用户昵称不能包含脚本字符")
    private String articleContent;

    /** 主图 */
    private String coverUrl;

    /** 首页显示开关 Y-N */
    private String showable;

    


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("dateStart", getDateStart())
            .append("dateEnd", getDateEnd())
            .append("remark", getRemark())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("deleted", getDeleted())
            .append("version", getVersion())
            .append("articleId", getArticleId())
            .append("articleTitle", getArticleTitle())
            .append("articleContent", getArticleContent())
            .append("coverUrl", getCoverUrl())
            .append("showable", getShowable())
            .toString();
    }
}
